<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript" src="../js/angular.min.js" ></script>
	</head>
	<body ng-app="myapp" ng-controller="mycontroller">
		<div> 
			<input type=text name="name" ng-model="name" />
			<!--添加一个清空按钮-->
			<input type="button" value="清空" ng-click="clearVal()" />
		</div>
		<div>
			你好：{{name}}
		</div>
	</body>
	<script type="text/javascript">
		//初始化myapp模块
		var myapp = angular.module("myapp",[]);
		//定义模块的控制器
		myapp.controller("mycontroller",["$scope",function($scope){
			$scope.clearVal=function(){
				//在控制器添加点击事件
				$scope.name="";
			}
		}]);
	</script>
</html>
